Sync Multi Leg Orders
🧾 Sync Multi Leg Order Request​
| Field | Details |
|---|---|
| API Name | SyncTrades (Provided exactly as in your source — although logically this endpoint should be named SyncMultiLegOrders) |
| URL Format | <protocol>://<domain name:port>/<VirtualDir>/<URL> |
| Example URL | https://localhost:8080/OTPA/V1/SyncMultiLegOrders |
| Description | This request retrieves all multi‑leg orders available in the system. Upon receiving this request, the system sends multi‑leg order information messages. The request must include jToken received in the Authentication API response. |
📤 Sync Multi Leg Order Request Parameters​
| Parameter | Data Type | Description |
|---|---|---|
| jMessageType | varchar(15) | Must be sent as SYNC_ORDER_REQ |
| jManagerID | varchar(50) | Manager Identification Number |
| jCustomerId | varchar(50) | Customer ID assigned to the user |
| jExchange | int | Exchange identifier |
| jToken | varchar(512) | Authentication token received in Authentication API response |
| jEntrySequenceNumber | int64 | Last received sequence number; default 0 if not provided |
| jRequestID | varchar(255) | Echo‑back field |
📦 Sync Multi Leg Orders Response​
The response contains the following parameters:
| Parameter | Data Type | Description |
|---|---|---|
| jManagerId | varchar(50) | User ID assigned to the user |
| jCustomerId | varchar(50) | Customer ID assigned to the user |
| jLastSyncedPacket | int | Indicates if this is the last packet: 1 = Last packet |
| jNoOfRecords | int | Number of multi‑leg order records included |
| jOrderMessage | Multi‑Leg Order Detail Structure (array) | Array containing multi‑leg order messages of size jNoOfRecords |
| jRequestID | varchar(255) | Echo‑back field |
| jResponseID | varchar(255) | System‑generated alphanumeric ID |
📡 Multi‑Leg Order Detail Structure​
Each entry within jOrderMessage includes the following parameters:
| Parameter (Key) | Data Type | Description |
|---|---|---|
| Cli Order Number | int | Gateway/Client order number (system‑generated) |
| Exchange | varchar(10) | Exchange |
| Order Type | varchar(50) | Order type |
| Book Type | varchar(10) | Book type (e.g., RL) |
| Order Status | varchar(15) | Multi‑leg order status |
| Reason | varchar(300) | Reason code for rejection (if any) |
| Order Validity | — | Validity of the multi‑leg order |
| Pro/Cli | int | Participant flag: • 2 → PRO• 1 → CLI |
| User ID | varchar(10) | Client code (blank for PRO orders) |
| DealerCode | varchar(5) | Unique user identification code |
| Part Code | varchar(12) | Participant code |
| Order Entry Time | varchar(10) | Order entry timestamp (e.g., 15Jun2018 15.25.15) |
| Last Modified Time | varchar(10) | Last modified timestamp (e.g., 15Jun2018 15.25.15) |
| Alias | varchar(5) | Alias ID; blank if not applicable |
| InitiatedBy | varchar(25) | Application from which order was initiated (e.g., ADMIN, NET) |
| ModifiedBy | varchar(25) | Application from which order was modified |
| InitiatedByUserId | varchar(25) | User ID that initiated the order |
| ModifiedByUserId | varchar(25) | User ID that modified the order |
| Price Difference | float | Price difference of spread tokens |
| 1st Exchange Order Number | int | First leg exchange order number |
| 1st Leg Scrip Token | int | First leg scrip token number |
| 1st Leg Symbol | varchar(13) | First leg security name |
| 1st Leg InstrumentName | varchar(6) | First leg instrument name |
| 1st Leg Expiry Date | varchar(10) | First leg expiry date (ddMMMyyyy, e.g., 24JUN2004). Applicable for F&O only; blank otherwise. |
| 1st Leg Strike Price | float | First leg strike price (in rupees). Applicable for options only; otherwise -1. |
| 1st Leg Option_Type | varchar(2) | First leg option type |
| 1st Leg Buy_Sell | int | Buy/Sell flag: • 1 → Buy• 2 → Sell |
| 1st Leg Order Original Qty | int | First leg original order quantity |
| 1st Leg Pending Qty | int | First leg pending quantity |
| 1st Leg TradedQTY | int | First leg traded quantity |
| 1st Leg Order Price | float | First leg order price (in rupees) |
| 1st Leg Product Type | varchar(5) | Product type of the first leg |
| 2nd Exchange Order Number | int | Second leg exchange order number |
| 2nd Leg Scrip Token | int | Second leg scrip token number |
| 2nd Leg Symbol | varchar(13) | Second leg security name |
| 2nd Leg InstrumentName | varchar(6) | Second leg instrument name |
| 2nd Leg Expiry Date | varchar(10) | Second leg expiry date (ddMMMyyyy, e.g., 24JUN2004). Applicable for F&O only; blank otherwise. |
| 2nd Leg Strike Price | float | Second leg strike price (in rupees). Applicable for options only; otherwise -1. |
| 2nd Leg Option_Type | varchar(2) | Second leg option type |
| 2nd Leg Buy_Sell | int | Second leg Buy/Sell flag: • 1 → Buy• 2 → Sell |
| 2nd Leg Order Original Qty | int | Second leg original order quantity |
| 2nd Leg Pending Qty | int | Second leg pending quantity |
| 2nd Leg TradedQTY | int | Second leg traded quantity |
| 2nd Leg Order Price | float | Second leg order price (in rupees) |
| 2nd Leg Product Type | varchar(5) | Product type for the second leg |
| 3rd Exchange Order Number | int | Third leg exchange order number |
| 3rd Leg Scrip Token | int | Third leg scrip token number |
| 3rd Leg Symbol | varchar(13) | Third leg security name |
| 3rd Leg InstrumentName | varchar(6) | Third leg instrument name |
| 3rd Leg Expiry Date | varchar(10) | Third leg expiry date (ddMMMyyyy, e.g., 24JUN2004). Applicable for F&O only; blank otherwise. |
| 3rd Leg Strike Price | float | Third leg strike price (in rupees). Applicable for options only; otherwise -1. |
| 3rd Leg Option_Type | varchar(2) | Third leg option type |
| 3rd Leg Buy_Sell | int | Third leg Buy/Sell flag: • 1 → Buy• 2 → Sell |
| 3rd Leg Order Original Qty | int | Third leg original order quantity |
| 3rd Leg Pending Qty | int | Third leg pending quantity |
| 3rd Leg TradedQTY | int | Third leg traded quantity |
| 3rd Leg Order Price | float | Third leg order price (in rupees) |
| 3rd Leg ProductType | varchar(5) | Product type of the third leg |
| LocationID | varchar(5) | Location ID (PIN + NSECTCLBRANCH ID + NSECTCLID + ALGO FLAG + VENDOR CODE) |
| User Remarks | varchar(50) | User‑provided remarks |
| Misc | varchar(50) | Miscellaneous details. Possible values: • SPO-LMT• SPO-MKT• PO-MKT• PO-LMT |
| Prot% | — | Valid only for BSE. Applicable when nMarket = 1. Divide value by 100; otherwise 0. |
| SequenceNo | int64 | Unique sequence number |
| UniqueCode | varchar(12) | Alphanumeric value with special characters |